﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Services;
using Common;
using EntityModel;
using System.Data.Entity;
using MvcPaging;

namespace Heart.Controllers
{
    public class WebConfigController : Controller
    {
        #region 公用属性
        private WebConfigService webConfigService = new WebConfigService();
        #endregion

        public ActionResult Index()
        {
            WebConfig web = webConfigService.GetModel();
            return View(web);
        }
        public ActionResult Update(FormCollection c)
        {
            WebConfig w=new WebConfig();
            w.Tel=WebBase.GetForm("Tel");
            w.Name = WebBase.GetForm("Name");
            w.StatisticsTool = WebBase.GetForm("StatisticsTool");
            w.KeyWord = WebBase.GetForm("KeyWord");
            w.Description = WebBase.GetForm("Description");
            w.Address = WebBase.GetForm("Address");
            w.Email = WebBase.GetForm("Email");
            w.Id = WebBase.GetFormInt("Id");
            w.Icp = WebBase.GetForm("Icp");
            webConfigService.UpdateConfig(w);
            return RedirectToAction("Index");
        }

    }
}
